package com.xszx.service.impl;

import com.xszx.entity.User;
import com.xszx.mapper.LoginMapper;
import com.xszx.service.LoginService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class LoginServiceImpl implements LoginService {
    @Resource
    private LoginMapper loginMapper;

    //    登录系统
    @Override
    public User login(User user) {
//        从数据库中查找
        User user1 = loginMapper.login(user);
        return user1;
    }

    //校验重名
    @Override
    public User getLoginName(String loginname) {
//        从数据库中查询是否存在重名
        User user1 = loginMapper.getLoginName(loginname);
        return user1;
    }


    @Override
    public void enroll(User user) {
        loginMapper.enroll(user);
    }






}
